@extends('layouts.user')
@section('title', '编辑用户头像')

@section('lift-contaier')
    <div class="box">
        <div class="padding-md">
            <div class="list-group text-center">
                @include('include.user.nav', ['ac' => 'avatar'])
            </div>
        </div>
    </div>
@endsection

@section('right-contaier')
    <div class="panel panel-default padding-md">
        <div class="panel-body padding-bg">
            <h2>
                <i class="fa fa-picture-o" aria-hidden="true"></i> 请选择图片</h2>
            <hr>
            <form method="POST" action="{{url('/user/update_avatar')}}" enctype="multipart/form-data" accept-charset="UTF-8">
                {{method_field('PATCH')}}
                {{csrf_field()}}
                <div id="image-preview-div">
                    <label for="exampleInputFile">请选择图片：</label>
                    <br><img id="preview-img" class="avatar-preview-img" src="{{cdn(Auth::user()->profile)}}" width="480" height="480">
                </div>
                <div class="form-group">
                    <input type="file" name="profile" id="file" onchange="getImgURL(this)">
                </div>
                <br><button class="btn btn-lg btn-primary" id="upload-button" type="submit">上传头像</button>
            </form>
        </div>
    </div>
@endsection

@section('js-document')
@endsection